import request from '@/utils/request';

/**
 * 查询打印记录列表
 *
 * @param {object} query
 */
export const listHistory = (query:any) => {
	return request({
		url: '/manage/history/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询打印记录详细
 *
 * @param {string} id
 */
export const getHistory = (id:string) => {
	return request({
		url: '/manage/history/' + id,
		method: 'get'
	});
};

/**
 * 新增打印记录
 *
 * @param {object} data
 */
export const addHistory = (data:any) => {
	return request({
		url: '/manage/history/add',
		method: 'post',
		data: data
	});
};

/**
 *  修改打印记录
 *
 * @param {object} data
 */
export const updateHistory = (data:any) => {
	return request({
		url: '/manage/history/edit',
		method: 'put',
		data: data
	});
};

/**
 * 删除打印记录
 *
 * @param {string} id
 */
export const delHistory = (id:string) => {
	return request({
		url: '/manage/history/' + id,
		method: 'delete'
	});
};

/**
 * 导出打印记录
 *
 * @param {object} query
 */
// export const exportHistory = (query:any) => {
// 	return request({
// 		url: '/manage/history/exportByStream',
// 		method: 'get',
// 		params: query
// 	});
// };

/**
 * 导出打印记录(返回流)
 *
 * @param {object} query
 */
export const exportHistory = (query:any) => {
	return request({
		url: '/manage/history/exportByStream',
		method: 'post',
		data: query
	});
};

/**
 * 查询打印记录统计报表
 * @param query 
 * @returns 
 */
export const listStatistics = (query?:any) => {
	return request({
		url: '/manage/history/listTj',
		method: 'get',
		params: query
	});
};
